.fei-menu-wrapper {
  --f-menu-collapse-width: var(--fei-menu-collapse-width);
  --f-menu-padding: var(--fei-menu-padding);
  --f-menu-item-height: var(--fei-menu-item-height);
  --f-menu-item-height-h: var(--fei-menu-item-height-h);
  --f-menu-item-border-radius: var(--fei-menu-item-border-radius);
  --f-menu-text-color: var(--fei-menu-text-color);
  --f-menu-text-hover-color: var(--fei-menu-text-hover-color);
  --f-menu-text-active-color: var(--fei-menu-text-active-color);
  --f-menu-bg-color: var(--fei-menu-bg-color);
  --f-menu-bg-hover-color: var(--fei-menu-bg-hover-color);
  --f-menu-bg-active-color: var(--fei-menu-bg-active-color);
}

.fei-menu-wrapper {
  padding: var(--f-menu-padding);
  overflow-x: hidden;
  transition: 0.2s;

  &.is-horizontal {
    padding: 0;
    border-bottom: solid 1px #e6e6e6;
  }

  &.is-collapse {
    padding: 0;
    width: var(--f-menu-collapse-width) !important;
  }
}

.fei-menu-item {
  display: flex;
  align-items: center;
  height: var(--f-menu-item-height);
  line-height: var(--f-menu-item-height);
  font-size: var(--fei-font-size-default);
  border-radius: var(--f-menu-item-border-radius);
  color: var(--f-menu-text-color);
  list-style: none;
  padding: 0 10px;
  margin-bottom: 4px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;

  &.is-tooltip {
    padding: 0;

    > div {
      padding-left: 12px !important;
    }
  }

  i {
    position: relative;
    top: -1px;
    color: inherit;
  }

  &:hover, &:focus {
    outline: 0;
    color: var(--f-menu-text-hover-color);
    background: var(--f-menu-bg-hover-color);
  }

  &.is-disabled {
    opacity: .25;
    cursor: not-allowed;
    background: 0 0 !important
  }

  .f-iconfont {
    margin-right: 5px;
    width: 24px;
    text-align: center;
    font-size: 18px;
    vertical-align: middle;
  }

  &.is-active {
    color: var(--f-menu-text-active-color);
    background: var(--f-menu-bg-active-color);

    i {
      color: inherit;
    }
  }

  .fei-tooltip {
    width: 100%;
    height: 100%;
  }

  &:last-child:not(:first-child) {
    margin-bottom: 0;
  }
}

.fei-submenu {
  list-style: none;
  margin: 0;
  padding-left: 0;

  &__title {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--f-menu-item-height);
    line-height: var(--f-menu-item-height);
    font-size: var(--fei-font-size-default);
    color: var(--f-menu-text-color);
    padding: 0 10px;
    cursor: pointer;
    border-radius: var(--f-menu-item-border-radius);
    margin-bottom: 4px;
    transition: border-color var(--fei-animation-duration-slow), background-color var(--fei-animation-duration-slow), color var(--fei-animation-duration-slow);
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;

    .f-iconfont {
      margin-right: 5px;
      width: 24px;
      text-align: center;
      font-size: 18px;
      vertical-align: middle;
    }

    * {
      vertical-align: middle;
    }

    i {
      color: inherit;
    }

    &:focus, &:hover {
      outline: 0;
      background: var(--fei-color-primary-light6);
    }

    &.is-active, &:hover {
      color: var(--f-menu-text-hover-color);
      background: var(--f-menu-bg-hover-color);
    }

    &.is-active {
      color: var(--f-menu-text-active-color);
      background: var(--f-menu-bg-active-color);
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  .fei-submenu__icon-arrow {
    position: absolute;
    top: 50%;
    right: 16px;
    margin-top: -7px;
    transition: transform .3s;
    font-size: 12px;
    line-height: 1;
    margin-right: 0;
  }

  &.is-opened > .fei-submenu__title .fei-submenu__icon-arrow {
    transform: rotate(180deg);
  }

  &.is-active {
    > .fei-submenu__title {
      color: var(--f-menu-text-active-color);
    }
  }

  .fei-submenu__icon-arrow {
    right: 8px;
  }
}

.fei-menu-item-group > ul {
  padding: 0
}

.fei-menu-item-group__title {
  padding: 7px 0 7px 20px;
  line-height: normal;
  font-size: 12px;
  color: var(--fei-color-text-disabled);
  overflow: hidden;
  white-space: nowrap;
}

.fei-menu {
  list-style: none;
  position: relative;
  user-select: none;
  margin: 0;
  padding-left: 0;
  //background-color: #FFF;

  &::before, &::after {
    display: table;
    content: '';
  }

  &::after {
    clear: both;
  }

  &--horizontal {
    border-right: none;

    > .fei-menu-item {
      float: left;
      height: var(--f-menu-item-height-h);
      line-height: var(--f-menu-item-height-h);
      margin: 0;
      border-bottom: 2px solid transparent;
      border-radius: 0;
      padding: 0 20px;

      a, a:hover {
        color: inherit;
      }

      &:not(.is-disabled):hover, &:not(.is-disabled):focus {
        background-color: #fff;
      }

      &.is-active {
        border-bottom: 2px solid var(--fei-color-primary);
        color: var(--fei-color-primary);
      }
    }

    > .fei-submenu {
      float: left;

      &:focus, &:hover {
        outline: none;

        .fei-menu-submenu__title {
          color: var(--fei-color-primary);
        }
      }

      &.is-active {
        .fei-submenu__title {
          border-bottom: 2px solid var(--fei-color-primary);
          color: var(--fei-color-primary);
        }
      }

      &.is-active {
        .fei-submenu__title {
          border-bottom: 2px solid var(--fei-color-primary);
          color: var(--fei-color-primary);
        }
      }

      .fei-submenu__title {
        height: var(--f-menu-item-height-h);
        line-height: var(--f-menu-item-height-h);
        border-bottom: 2px solid transparent;
        color: var(--fei-color-text-default);
        border-radius: 0;
        padding: 0 20px;

        &:hover {
          background-color: #fff;
        }
      }

      .fei-submenu__icon-arrow {
        position: static;
        vertical-align: middle;
        margin-left: 8px;
        margin-right: 0;
        margin-top: -3px;
      }
    }
  }
}

.fei-menu--popup {
  z-index: 100;
  min-width: 180px;
  border: none;
  padding: 5px 0;
  border-radius: var(--fei-border-radius-default);
  box-shadow: var(--fei-shadow-down);

  .fei-menu-item, .fei-submenu__title {
    height: var(--f-menu-item-height);
    line-height: var(--f-menu-item-height);
    padding: 0 10px;
    &:hover {
      color: var(--f-menu-text-hover-color);
      background: var(--f-menu-bg-hover-color);
    }

    &.is-active {
      color: var(--f-menu-text-active-color);
      background: var(--f-menu-bg-active-color);
    }
  }
}

.fei-submenu-popper.fei-popper.is-light {
  border: none;
}

.fei-menu--collapse {
  width: var(--f-menu-collapse-width);

  .fei-submenu .fei-menu {
    position: absolute;
    margin-left: 5px;
    top: 0;
    left: 100%;
    z-index: 10;
    border: 1px solid #E4E7ED;
    border-radius: 2px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1)
  }

  > .fei-menu-item,
  > .fei-submenu > .fei-submenu__title {
    .f-iconfont {
      margin: 0;
      vertical-align: middle;
      width: 24px;
      text-align: center;
    }

    span {
      height: 0;
      width: 0;
      overflow: hidden;
      visibility: hidden;
      display: inline-block;
    }
  }

  .fei-submenu {
    position: relative
  }

  .fei-submenu__icon-arrow {
    display: none;
  }

  .fei-submenu.is-opened > .fei-submenu__title .fei-submenu__icon-arrow {
    transform: none;
  }

  .fei-submenu__title {
    justify-content: center;
    padding: 0 !important;
  }
}

.fei-menu--popup {
  --b-menu-collapse-width: var(--fei-menu-collapse-width);
  --b-menu-padding: var(--fei-menu-padding);
  --b-menu-item-height: var(--fei-menu-item-height);
  --b-menu-item-height-h: var(--fei-menu-item-height-h);
  --b-menu-item-border-radius: var(--fei-menu-item-border-radius);
  --b-menu-text-color: var(--fei-menu-text-color);
  --b-menu-text-hover-color: var(--fei-menu-text-hover-color);
  --b-menu-text-active-color: var(--fei-menu-text-active-color);
  --b-menu-bg-color: var(--fei-menu-bg-color);
  --b-menu-bg-hover-color: var(--fei-menu-bg-hover-color);
  --b-menu-bg-active-color: var(--fei-menu-bg-active-color);
  z-index: 100;
  min-width: 180px;
  border: none;
  padding: 5px 0;
  border-radius: var(--fei-border-radius-default);
  box-shadow: var(--fei-shadow-down);
  background: var(--b-menu-bg-color);

  .fei-menu-item, .fei-submenu__title {
    height: var(--b-menu-item-height);
    line-height: var(--b-menu-item-height);
    padding: 0 10px;

    &:hover {
      color: var(--b-menu-text-hover-color);
      background: var(--b-menu-bg-hover-color);
    }

    &.is-active {
      color: var(--b-menu-text-active-color);
      background: var(--b-menu-bg-active-color);
    }
  }
}

.fei-submenu-popper.fei-popper.is-light {
  border: none;
}

.fei-menu--collapse {
  width: var(--b-menu-collapse-width);

  .fei-submenu .fei-menu {
    position: absolute;
    margin-left: 5px;
    top: 0;
    left: 100%;
    z-index: 10;
    border: 1px solid #E4E7ED;
    border-radius: 2px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }

  > .fei-menu-item, > .fei-submenu > .fei-submenu__title {
    .b-iconfont {
      margin: 0;
      vertical-align: middle;
      width: 24px;
      text-align: center;
    }

    span {
      height: 0;
      width: 0;
      overflow: hidden;
      visibility: hidden;
      display: inline-block;
    }
  }

  .fei-submenu {
    position: relative;
  }

  .fei-submenu__icon-arrow {
    display: none;
  }

  .fei-submenu.is-opened > .fei-submenu__title .fei-submenu__icon-arrow {
    transform: none;
  }

  .fei-submenu__title {
    justify-content: center;
    padding: 0 !important;
  }
}

.horizontal-collapse-transition .fei-submenu__title .fei-submenu__icon-arrow {
  -webkit-transition: .2s;
  transition: .2s;
  opacity: 0
}

.fei-opacity-transition {
  -webkit-transition: opacity .3s cubic-bezier(.55, 0, .1, 1);
  transition: opacity .3s cubic-bezier(.55, 0, .1, 1)
}
